package JD_CAST_KEY;

import java.io.File;
import java.util.HashMap;

public class Example {
    HashMap len=new HashMap();

    void fill(File dir){
        File[] list = dir.listFiles();
        for (int i = 0; i < list.length; i++) {
            File file = list[i];
            len.put(file, new Long(file.length()));
        }
    }

    int getLength(String file){
        Long l = (Long) len.get(file);
        if (l!=null) return l.intValue();
        return 0;
    }
}
